<template>
  <div class="背景">
    <div class="页眉">
    </div>
    <el-row :gutter="16"
            type="flex"
            justify="center">
      <el-col :span="4">

        <side-bar>
        </side-bar>
      </el-col>
      <el-col :span="12">
        <news-main v-if="isRouterAlive"></news-main>
      </el-col>

      <el-col :span="6">

        <right-side-bar>
        </right-side-bar>

      </el-col>
    </el-row>
    
  </div>
</template>


<style>

</style>

<script>
import RightSideBar from '../FuHeadline/RightSideBar.vue'

import SideBar from "../FuHeadline/SideBar.vue"
import NewsMain from "./NewsMain.vue"
export default {
  components: { SideBar, NewsMain, RightSideBar },
  provide () {    //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。                                             
    return {
      reload: this.reload
    }
  },

  data () {


    return {
      search: '',
      activeName: 0,
      isRouterAlive: true

    }
  },
  methods: {
    toLogin () {
      this.$router.push("/Login");
    },
    reload () {
      this.isRouterAlive = false;            //先关闭，
      this.$nextTick(function () {
        this.isRouterAlive = true;         //再打开
      })
    }
  }

}

</script>